package org.stu.tp.testCases.phoneSetting;

import org.stu.tp.core.BaseSac;
import org.stu.tp.core.DefaultAjaxSelenium;

public class PhoneSettingBaseSac extends BaseSac {

	/**
	 * Click phone setting link and wait for page to load.
	 * @param selenium
	 */
	public void accessPhoneSetting(DefaultAjaxSelenium selenium) {
		selenium.clickAt("wb_0_Item_2", "");
		this.waitForPageToLoad(selenium);
	}

	/**
	 * Click the arrow to expand the panel or not.
	 * note: There is no waiting for element to be visible.
	 * @param selenium
	 * @param index: the order of the panel  set off "1"
	 */
	public void clickPanelArrow(DefaultAjaxSelenium selenium, int index) {
		switch (index) {
		case 1:
			selenium.click("ctl00contentWebPanel2_header_img");
			break;
		case 2:
			selenium.click("ctl00contentWebPanel1_header_img");
			break;
		case 3:
			selenium.click("ctl00contentWebPanel3_header_img");
			break;
		case 4:
			selenium.click("ctl00contentWebPanel4_header_img");
			break;
		}
	}
	
	public void loginAndAccessPhoneSetting(DefaultAjaxSelenium selenium){
		this.loginByDefault(selenium);
		this.accessPhoneSetting(selenium);
	}
}
